public class HomePageApprovalItemMedical
{
     public List<ProcessInstanceWorkitem > ProcessList{get;set;}
     public List<ProcessInstanceWorkitem > CheckInvProcessList{get;set;}
     public String ActivityObjectPrefix{get;set;}
     public String OrderObjectPrefix{get;set;}
     public String CheckInventoryObjectPrefix{get;set;}
     
    public HomePageApprovalItemMedical()
    {
         ActivityObjectPrefix= Participator_Detail_Area__c.sObjectType.getDescribe().getKeyPrefix();   
         OrderObjectPrefix=Order__c.sObjectType.getDescribe().getKeyPrefix();
         CheckInventoryObjectPrefix=CheckInventory__c.sObjectType.getDescribe().getKeyPrefix();
         CheckInvProcessList = new List<ProcessInstanceWorkitem >();
         
        ProcessList=[Select ProcessInstance.Status, ProcessInstance.TargetObjectId, ProcessInstance.Id, ProcessInstanceId,
         Id,CREATEDDATE,CREATEDBYID
         From ProcessInstanceWorkitem where ProcessInstance.Status='Pending' and ACTORID=:UserInfo.getUserId() order by CREATEDDATE desc];
        for(ProcessInstanceWorkitem p : ProcessList)
        {
            if(String.valueof(p.ProcessInstance.TargetObjectId).substring(0,3) == CheckInventoryObjectPrefix.substring(0,3))
                CheckInvProcessList.add(p);
        }
         
    }
  
}